package com.eascs.crm.nsEditDetail.validator;

import java.lang.annotation.Annotation;
import java.lang.reflect.Field;
import java.text.ParseException;
import java.text.SimpleDateFormat;
import java.util.ArrayList;
import java.util.Collections;
import java.util.Date;
import java.util.List;

import org.junit.runner.RunWith;
import org.springframework.beans.factory.annotation.Autowired;
import org.springframework.context.annotation.Configuration;
import org.springframework.stereotype.Component;
import org.springframework.stereotype.Controller;
import org.springframework.test.context.ContextConfiguration;
import org.springframework.test.context.junit4.SpringJUnit4ClassRunner;
import org.springframework.util.Assert;
import org.springframework.validation.BindException;
import org.springframework.validation.Errors;
import org.springframework.web.bind.annotation.RequestMapping;

@Controller
@RequestMapping("/test1")
public class Test {

	@Autowired  
    private CustomerValidatorFactory customerValidatorFactory;  
  
    @RequestMapping("/test")
    public void helloTest() {  
        Form form = new Form();  
        form.setCurrent("21");  
        BindException errors = new BindException(form, "target");  
        customerValidatorFactory.validate(form, errors);  
        System.out.println(errors.getFieldErrors());  
    }  
}
